<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="icon" type="image/x-icon" href="favicon.ico" />
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>chigraph: lib/core/include/chi/Context.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="chigraphDoxygenIcon.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">chigraph
   &#160;<span id="projectnumber">master</span>
   </div>
   <div id="projectbrief">Systems programming language written for beginners in LLVM</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('Context_8hpp_source.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">Context.hpp</div>  </div>
</div><!--header-->
<div class="contents">
<a href="Context_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="preprocessor">#ifndef CHI_CONTEXT_HPP</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="preprocessor">#define CHI_CONTEXT_HPP</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;</div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="preprocessor">#pragma once</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;</div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="preprocessor">#include &lt;memory&gt;</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="preprocessor">#include &lt;unordered_map&gt;</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;</div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="core_2include_2chi_2Fwd_8hpp.html">chi/Fwd.hpp</a>&quot;</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="ModuleCache_8hpp.html">chi/ModuleCache.hpp</a>&quot;</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="Flags_8hpp.html">chi/Support/Flags.hpp</a>&quot;</span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="preprocessor">#include &quot;chi/Support/json.hpp&quot;</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;</div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="preprocessor">#include &lt;llvm/IR/LLVMContext.h&gt;</span></div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="preprocessor">#include &lt;llvm/Support/CodeGen.h&gt;</span>  <span class="comment">// for CodeGenOpt</span></div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;</div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="preprocessor">#include &lt;boost/filesystem/path.hpp&gt;</span></div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="preprocessor">#include &lt;boost/utility/string_view.hpp&gt;</span></div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;</div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespacechi.html">chi</a> {</div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;</div><div class="line"><a name="l00026"></a><span class="lineno"><a class="line" href="namespacechi.html#a5ebe31b8bd52ced63520fbfd749e757f">   26</a></span>&#160;<span class="keyword">enum class</span> <a class="code" href="namespacechi.html#a5ebe31b8bd52ced63520fbfd749e757f">CompileSettings</a> {</div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;</div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;    <a class="code" href="namespacechi.html#a5ebe31b8bd52ced63520fbfd749e757fadcd9e587bf9e3e50e28d85f642306d33">UseCache</a> = 1u,</div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;</div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;    <a class="code" href="namespacechi.html#a5ebe31b8bd52ced63520fbfd749e757fa4f2978dbcab4d04e98b1a567eae27604">LinkDependencies</a> = 1u &lt;&lt; 1,</div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;</div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;    <a class="code" href="namespacechi.html#a5ebe31b8bd52ced63520fbfd749e757fa7a1920d61156abc05a60135aefe8bc67">Default</a> = <a class="code" href="namespacechi.html#a5ebe31b8bd52ced63520fbfd749e757fadcd9e587bf9e3e50e28d85f642306d33">UseCache</a> | LinkDependencies</div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;};</div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;</div><div class="line"><a name="l00055"></a><span class="lineno"><a class="line" href="structchi_1_1Context.html">   55</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structchi_1_1Context.html">Context</a> {</div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;    <a class="code" href="structchi_1_1Context.html">Context</a>(<span class="keyword">const</span> boost::filesystem::path&amp; workPath = {});</div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;    ~<a class="code" href="structchi_1_1Context.html">Context</a>();</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;</div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;    <span class="comment">// no move or copy, doesn&#39;t make sense</span></div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;    <a class="code" href="structchi_1_1Context.html">Context</a>(<span class="keyword">const</span> <a class="code" href="structchi_1_1Context.html">Context</a>&amp; context) = <span class="keyword">delete</span>;</div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;    <a class="code" href="structchi_1_1Context.html">Context</a>(<a class="code" href="structchi_1_1Context.html">Context</a>&amp;&amp;)              = <span class="keyword">delete</span>;</div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;</div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;    <a class="code" href="structchi_1_1ChiModule.html">ChiModule</a>* moduleByFullName(<span class="keyword">const</span> boost::filesystem::path&amp; fullModuleName) <span class="keyword">const</span> noexcept;</div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;    <a class="code" href="structchi_1_1GraphModule.html">GraphModule</a>* newGraphModule(<span class="keyword">const</span> boost::filesystem::path&amp; fullName);</div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;    <span class="comment">// init it (pretty sure it inits windows networking stuff)</span></div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;    std::vector&lt;std::string&gt; listModulesInWorkspace() <span class="keyword">const</span> noexcept;</div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;</div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;    <a class="code" href="structchi_1_1Result.html">Result</a> loadModule(<span class="keyword">const</span> boost::filesystem::path&amp; name, <a class="code" href="structchi_1_1ChiModule.html">ChiModule</a>** toFill = <span class="keyword">nullptr</span>);</div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;</div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;    <a class="code" href="structchi_1_1Result.html">Result</a> addModuleFromJson(<span class="keyword">const</span> boost::filesystem::path&amp; fullName, <span class="keyword">const</span> nlohmann::json&amp; json,</div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;                             <a class="code" href="structchi_1_1GraphModule.html">GraphModule</a>** toFill = <span class="keyword">nullptr</span>);</div><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;</div><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;    <span class="keywordtype">bool</span> addModule(std::unique_ptr&lt;ChiModule&gt; modToAdd) noexcept;</div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;</div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;    <span class="keywordtype">bool</span> unloadModule(<span class="keyword">const</span> boost::filesystem::path&amp; fullName);</div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;</div><div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;    <a class="code" href="structchi_1_1Result.html">Result</a> typeFromModule(<span class="keyword">const</span> boost::filesystem::path&amp; module, boost::string_view name,</div><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;                          <a class="code" href="structchi_1_1DataType.html">DataType</a>* toFill) noexcept;</div><div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;</div><div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;    <a class="code" href="structchi_1_1Result.html">Result</a> nodeTypeFromModule(<span class="keyword">const</span> boost::filesystem::path&amp; moduleName,</div><div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;                              boost::string_view typeName, <span class="keyword">const</span> nlohmann::json&amp; data,</div><div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;                              std::unique_ptr&lt;NodeType&gt;* toFill) noexcept;</div><div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;                              </div><div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;    std::unique_ptr&lt;NodeType&gt; createConverterNodeType(<span class="keyword">const</span> <a class="code" href="structchi_1_1DataType.html">DataType</a>&amp; fromType, <span class="keyword">const</span> <a class="code" href="structchi_1_1DataType.html">DataType</a>&amp; toType);</div><div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;</div><div class="line"><a name="l00138"></a><span class="lineno"><a class="line" href="structchi_1_1Context.html#a24fd4f52e8cc081116a45de3a698d846">  138</a></span>&#160;    boost::filesystem::path <a class="code" href="structchi_1_1Context.html#a24fd4f52e8cc081116a45de3a698d846">workspacePath</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mWorkspacePath; }</div><div class="line"><a name="l00141"></a><span class="lineno"><a class="line" href="structchi_1_1Context.html#a79e291c879b4017b47ef9605e1e638ba">  141</a></span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="structchi_1_1Context.html#a79e291c879b4017b47ef9605e1e638ba">hasWorkspace</a>() const noexcept { <span class="keywordflow">return</span> !workspacePath().empty(); }</div><div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;</div><div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;    <a class="code" href="structchi_1_1Result.html">Result</a> compileModule(<span class="keyword">const</span> boost::filesystem::path&amp; fullName, <a class="code" href="structchi_1_1Flags.html">Flags&lt;CompileSettings&gt;</a> settings,</div><div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;                         std::unique_ptr&lt;llvm::Module&gt;* toFill);</div><div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;</div><div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;    <a class="code" href="structchi_1_1Result.html">Result</a> compileModule(<a class="code" href="structchi_1_1ChiModule.html">ChiModule</a>&amp; mod, <a class="code" href="structchi_1_1Flags.html">Flags&lt;CompileSettings&gt;</a> settings,</div><div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;                         std::unique_ptr&lt;llvm::Module&gt;* toFill);</div><div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;</div><div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;    std::vector&lt;NodeInstance*&gt; findInstancesOfType(<span class="keyword">const</span> boost::filesystem::path&amp; moduleName,</div><div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;                                                   boost::string_view             typeName) <span class="keyword">const</span>;</div><div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;</div><div class="line"><a name="l00173"></a><span class="lineno"><a class="line" href="structchi_1_1Context.html#a8b0dca76be969f24e02a1d286aea377c">  173</a></span>&#160;    llvm::LLVMContext&amp; <a class="code" href="structchi_1_1Context.html#a8b0dca76be969f24e02a1d286aea377c">llvmContext</a>() { <span class="keywordflow">return</span> mLLVMContext; }</div><div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;</div><div class="line"><a name="l00177"></a><span class="lineno"><a class="line" href="structchi_1_1Context.html#ab109ef2d751346da8db6d7c44fb0cd90">  177</a></span>&#160;    <a class="code" href="structchi_1_1LangModule.html">LangModule</a>* <a class="code" href="structchi_1_1Context.html#ab109ef2d751346da8db6d7c44fb0cd90">langModule</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mLangModule; }</div><div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;</div><div class="line"><a name="l00181"></a><span class="lineno"><a class="line" href="structchi_1_1Context.html#acd60f2fe31d69d0c37652fb47fcf7b60">  181</a></span>&#160;    std::vector&lt;ChiModule*&gt; <a class="code" href="structchi_1_1Context.html#acd60f2fe31d69d0c37652fb47fcf7b60">modules</a>()<span class="keyword"> const </span>{</div><div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;        std::vector&lt;ChiModule*&gt; ret;</div><div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;</div><div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;        <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span>&amp; mod : mModules) { ret.push_back(mod.get()); }</div><div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;</div><div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;        <span class="keywordflow">return</span> ret;</div><div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;    }</div><div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;</div><div class="line"><a name="l00191"></a><span class="lineno"><a class="line" href="structchi_1_1Context.html#afdf2d810191484be60d79abb03c5f7a7">  191</a></span>&#160;    <span class="keyword">const</span> <a class="code" href="structchi_1_1ModuleCache.html">ModuleCache</a>&amp; <a class="code" href="structchi_1_1Context.html#afdf2d810191484be60d79abb03c5f7a7">moduleCache</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> *mModuleCache; }</div><div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;</div><div class="line"><a name="l00194"></a><span class="lineno"><a class="line" href="structchi_1_1Context.html#a36c12b871ae11ae59a5ec1f2f2842ec7">  194</a></span>&#160;    <a class="code" href="structchi_1_1ModuleCache.html">ModuleCache</a>&amp; <a class="code" href="structchi_1_1Context.html#a36c12b871ae11ae59a5ec1f2f2842ec7">moduleCache</a>() { <span class="keywordflow">return</span> *mModuleCache; }</div><div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;</div><div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;    <span class="keywordtype">void</span> setModuleCache(std::unique_ptr&lt;ModuleCache&gt; newCache);</div><div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;</div><div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;<span class="keyword">private</span>:</div><div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160;    boost::filesystem::path mWorkspacePath;</div><div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;</div><div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;    llvm::LLVMContext mLLVMContext;</div><div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160;</div><div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;    std::vector&lt;std::unique_ptr&lt;ChiModule&gt;&gt; mModules;</div><div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160;</div><div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160;    <span class="comment">// This cache is only for use during compilation to not duplicate modules</span></div><div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;    std::unordered_map&lt;std::string <span class="comment">/*full name*/</span>, llvm::Module* <span class="comment">/*the compiled module*/</span>&gt;</div><div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;        mCompileCache;</div><div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;</div><div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;    <a class="code" href="structchi_1_1LangModule.html">LangModule</a>* mLangModule = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l00213"></a><span class="lineno">  213</span>&#160;</div><div class="line"><a name="l00214"></a><span class="lineno">  214</span>&#160;    std::unique_ptr&lt;ModuleCache&gt; mModuleCache;</div><div class="line"><a name="l00215"></a><span class="lineno">  215</span>&#160;    </div><div class="line"><a name="l00216"></a><span class="lineno">  216</span>&#160;    std::unordered_map&lt;std::string <span class="comment">/*from Type*/</span>, std::unordered_map&lt;std::string <span class="comment">/*to type*/</span>, std::unique_ptr&lt;NodeType&gt;&gt;&gt; mTypeConverters;</div><div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;};</div><div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;</div><div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160;boost::filesystem::path <a class="code" href="namespacechi.html#af9629143a0367909c7d5173453012335">workspaceFromChildPath</a>(<span class="keyword">const</span> boost::filesystem::path&amp; path);</div><div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160;</div><div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;std::string <a class="code" href="namespacechi.html#a29ff9f3364b9ad0f25a990b8373971b4">stringifyLLVMType</a>(llvm::Type* ty);</div><div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160;</div><div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160;<a class="code" href="structchi_1_1Result.html">Result</a> <a class="code" href="namespacechi.html#a0fd66f4db0dbade845553826bd971190">interpretLLVMIR</a>(std::unique_ptr&lt;llvm::Module&gt;          mod,</div><div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160;                       llvm::CodeGenOpt::Level                optLevel = llvm::CodeGenOpt::Default,</div><div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160;                       <span class="keyword">const</span> std::vector&lt;llvm::GenericValue&gt;&amp; args     = {},</div><div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160;                       llvm::Function* funcToRun = <span class="keyword">nullptr</span>, llvm::GenericValue* ret = <span class="keyword">nullptr</span>);</div><div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;</div><div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160;<a class="code" href="structchi_1_1Result.html">Result</a> <a class="code" href="namespacechi.html#a33d2592c56c0b169c44b14332e80db44">interpretLLVMIRAsMain</a>(std::unique_ptr&lt;llvm::Module&gt;   mod,</div><div class="line"><a name="l00252"></a><span class="lineno">  252</span>&#160;                             llvm::CodeGenOpt::Level         optLevel = llvm::CodeGenOpt::Default,</div><div class="line"><a name="l00253"></a><span class="lineno">  253</span>&#160;                             <span class="keyword">const</span> std::vector&lt;std::string&gt;&amp; args     = {},</div><div class="line"><a name="l00254"></a><span class="lineno">  254</span>&#160;                             llvm::Function* funcToRun = <span class="keyword">nullptr</span>, <span class="keywordtype">int</span>* ret = <span class="keyword">nullptr</span>);</div><div class="line"><a name="l00255"></a><span class="lineno">  255</span>&#160;}  <span class="comment">// namespace chi</span></div><div class="line"><a name="l00256"></a><span class="lineno">  256</span>&#160;</div><div class="line"><a name="l00257"></a><span class="lineno">  257</span>&#160;<span class="preprocessor">#endif  // CHI_CONTEXT_HPP</span></div><div class="ttc" id="structchi_1_1Context_html_ab109ef2d751346da8db6d7c44fb0cd90"><div class="ttname"><a href="structchi_1_1Context.html#ab109ef2d751346da8db6d7c44fb0cd90">chi::Context::langModule</a></div><div class="ttdeci">LangModule * langModule() const</div><div class="ttdoc">Get the LangModule, if it has been loaded. </div><div class="ttdef"><b>Definition:</b> <a href="Context_8hpp_source.html#l00177">Context.hpp:177</a></div></div>
<div class="ttc" id="core_2include_2chi_2Fwd_8hpp_html"><div class="ttname"><a href="core_2include_2chi_2Fwd_8hpp.html">Fwd.hpp</a></div><div class="ttdoc">Forward declares all the chigraph data types. </div></div>
<div class="ttc" id="structchi_1_1LangModule_html"><div class="ttname"><a href="structchi_1_1LangModule.html">chi::LangModule</a></div><div class="ttdoc">The module that provides built-in operations like literals, math operations, etc. ...</div><div class="ttdef"><b>Definition:</b> <a href="LangModule_8hpp_source.html#l00016">LangModule.hpp:16</a></div></div>
<div class="ttc" id="namespacechi_html_a5ebe31b8bd52ced63520fbfd749e757fa7a1920d61156abc05a60135aefe8bc67"><div class="ttname"><a href="namespacechi.html#a5ebe31b8bd52ced63520fbfd749e757fa7a1920d61156abc05a60135aefe8bc67">chi::CompileSettings::Default</a></div><div class="ttdoc">Default, which is both. </div></div>
<div class="ttc" id="structchi_1_1Context_html_a24fd4f52e8cc081116a45de3a698d846"><div class="ttname"><a href="structchi_1_1Context.html#a24fd4f52e8cc081116a45de3a698d846">chi::Context::workspacePath</a></div><div class="ttdeci">boost::filesystem::path workspacePath() const</div><div class="ttdoc">Get the workspace path of the Context. </div><div class="ttdef"><b>Definition:</b> <a href="Context_8hpp_source.html#l00138">Context.hpp:138</a></div></div>
<div class="ttc" id="ModuleCache_8hpp_html"><div class="ttname"><a href="ModuleCache_8hpp.html">ModuleCache.hpp</a></div></div>
<div class="ttc" id="structchi_1_1Context_html_acd60f2fe31d69d0c37652fb47fcf7b60"><div class="ttname"><a href="structchi_1_1Context.html#acd60f2fe31d69d0c37652fb47fcf7b60">chi::Context::modules</a></div><div class="ttdeci">std::vector&lt; ChiModule * &gt; modules() const</div><div class="ttdoc">Get the modules in the Context. </div><div class="ttdef"><b>Definition:</b> <a href="Context_8hpp_source.html#l00181">Context.hpp:181</a></div></div>
<div class="ttc" id="namespacechi_html_a5ebe31b8bd52ced63520fbfd749e757f"><div class="ttname"><a href="namespacechi.html#a5ebe31b8bd52ced63520fbfd749e757f">chi::CompileSettings</a></div><div class="ttdeci">CompileSettings</div><div class="ttdoc">Settings for compiling modules. </div><div class="ttdef"><b>Definition:</b> <a href="Context_8hpp_source.html#l00026">Context.hpp:26</a></div></div>
<div class="ttc" id="namespacechi_html_af9629143a0367909c7d5173453012335"><div class="ttname"><a href="namespacechi.html#af9629143a0367909c7d5173453012335">chi::workspaceFromChildPath</a></div><div class="ttdeci">boost::filesystem::path workspaceFromChildPath(const boost::filesystem::path &amp;path)</div><div class="ttdoc">Get the workspace directory from a child of the workspace directory Example: say you have a workspace...</div><div class="ttdef"><b>Definition:</b> <a href="Context_8cpp_source.html#l00462">Context.cpp:462</a></div></div>
<div class="ttc" id="structchi_1_1Context_html"><div class="ttname"><a href="structchi_1_1Context.html">chi::Context</a></div><div class="ttdoc">The class that handles the loading, creation, storing, and compilation of modules It also stores a LL...</div><div class="ttdef"><b>Definition:</b> <a href="Context_8hpp_source.html#l00055">Context.hpp:55</a></div></div>
<div class="ttc" id="structchi_1_1ChiModule_html"><div class="ttname"><a href="structchi_1_1ChiModule.html">chi::ChiModule</a></div><div class="ttdoc">An abstract class that represents a module of code in Chigraph Can be compiled to a llvm::Module...</div><div class="ttdef"><b>Definition:</b> <a href="ChiModule_8hpp_source.html#l00024">ChiModule.hpp:24</a></div></div>
<div class="ttc" id="namespacechi_html_a33d2592c56c0b169c44b14332e80db44"><div class="ttname"><a href="namespacechi.html#a33d2592c56c0b169c44b14332e80db44">chi::interpretLLVMIRAsMain</a></div><div class="ttdeci">Result interpretLLVMIRAsMain(std::unique_ptr&lt; llvm::Module &gt; mod, llvm::CodeGenOpt::Level optLevel=llvm::CodeGenOpt::Default, const std::vector&lt; std::string &gt; &amp;args={}, llvm::Function *funcToRun=nullptr, int *ret=nullptr)</div><div class="ttdoc">Interpret LLVM IR as if it were the main function. </div><div class="ttdef"><b>Definition:</b> <a href="Context_8cpp_source.html#l00564">Context.cpp:564</a></div></div>
<div class="ttc" id="structchi_1_1Context_html_a36c12b871ae11ae59a5ec1f2f2842ec7"><div class="ttname"><a href="structchi_1_1Context.html#a36c12b871ae11ae59a5ec1f2f2842ec7">chi::Context::moduleCache</a></div><div class="ttdeci">ModuleCache &amp; moduleCache()</div><div class="ttdoc">Get the module cache. </div><div class="ttdef"><b>Definition:</b> <a href="Context_8hpp_source.html#l00194">Context.hpp:194</a></div></div>
<div class="ttc" id="namespacechi_html_a0fd66f4db0dbade845553826bd971190"><div class="ttname"><a href="namespacechi.html#a0fd66f4db0dbade845553826bd971190">chi::interpretLLVMIR</a></div><div class="ttdeci">Result interpretLLVMIR(std::unique_ptr&lt; llvm::Module &gt; mod, llvm::CodeGenOpt::Level optLevel=llvm::CodeGenOpt::Default, const std::vector&lt; llvm::GenericValue &gt; &amp;args={}, llvm::Function *funcToRun=nullptr, llvm::GenericValue *ret=nullptr)</div><div class="ttdoc">Interpret LLVM IR, just a convenience function. </div><div class="ttdef"><b>Definition:</b> <a href="Context_8cpp_source.html#l00528">Context.cpp:528</a></div></div>
<div class="ttc" id="structchi_1_1Flags_html"><div class="ttname"><a href="structchi_1_1Flags.html">chi::Flags</a></div><div class="ttdoc">A template class for type-safe flags. </div><div class="ttdef"><b>Definition:</b> <a href="Flags_8hpp_source.html#l00026">Flags.hpp:26</a></div></div>
<div class="ttc" id="structchi_1_1Context_html_a8b0dca76be969f24e02a1d286aea377c"><div class="ttname"><a href="structchi_1_1Context.html#a8b0dca76be969f24e02a1d286aea377c">chi::Context::llvmContext</a></div><div class="ttdeci">llvm::LLVMContext &amp; llvmContext()</div><div class="ttdoc">Get the LLVMContext </div><div class="ttdef"><b>Definition:</b> <a href="Context_8hpp_source.html#l00173">Context.hpp:173</a></div></div>
<div class="ttc" id="structchi_1_1Context_html_afdf2d810191484be60d79abb03c5f7a7"><div class="ttname"><a href="structchi_1_1Context.html#afdf2d810191484be60d79abb03c5f7a7">chi::Context::moduleCache</a></div><div class="ttdeci">const ModuleCache &amp; moduleCache() const</div><div class="ttdoc">Get the module cache. </div><div class="ttdef"><b>Definition:</b> <a href="Context_8hpp_source.html#l00191">Context.hpp:191</a></div></div>
<div class="ttc" id="structchi_1_1ModuleCache_html"><div class="ttname"><a href="structchi_1_1ModuleCache.html">chi::ModuleCache</a></div><div class="ttdoc">This class provides an interface for creating module caches. </div><div class="ttdef"><b>Definition:</b> <a href="ModuleCache_8hpp_source.html#l00016">ModuleCache.hpp:16</a></div></div>
<div class="ttc" id="structchi_1_1GraphModule_html"><div class="ttname"><a href="structchi_1_1GraphModule.html">chi::GraphModule</a></div><div class="ttdoc">Module that holds graph functions. </div><div class="ttdef"><b>Definition:</b> <a href="GraphModule_8hpp_source.html#l00016">GraphModule.hpp:16</a></div></div>
<div class="ttc" id="structchi_1_1Context_html_a79e291c879b4017b47ef9605e1e638ba"><div class="ttname"><a href="structchi_1_1Context.html#a79e291c879b4017b47ef9605e1e638ba">chi::Context::hasWorkspace</a></div><div class="ttdeci">bool hasWorkspace() const noexcept</div><div class="ttdoc">Check if this context has a workspace bound to it – same as !workspacePath().empty() ...</div><div class="ttdef"><b>Definition:</b> <a href="Context_8hpp_source.html#l00141">Context.hpp:141</a></div></div>
<div class="ttc" id="namespacechi_html"><div class="ttname"><a href="namespacechi.html">chi</a></div><div class="ttdoc">The namespace where chigraph lives. </div><div class="ttdef"><b>Definition:</b> <a href="BitcodeParser_8hpp_source.html#l00012">BitcodeParser.hpp:12</a></div></div>
<div class="ttc" id="namespacechi_html_a5ebe31b8bd52ced63520fbfd749e757fadcd9e587bf9e3e50e28d85f642306d33"><div class="ttname"><a href="namespacechi.html#a5ebe31b8bd52ced63520fbfd749e757fadcd9e587bf9e3e50e28d85f642306d33">chi::CompileSettings::UseCache</a></div><div class="ttdoc">Use the cache in lib. </div></div>
<div class="ttc" id="namespacechi_html_a29ff9f3364b9ad0f25a990b8373971b4"><div class="ttname"><a href="namespacechi.html#a29ff9f3364b9ad0f25a990b8373971b4">chi::stringifyLLVMType</a></div><div class="ttdeci">std::string stringifyLLVMType(llvm::Type *ty)</div><div class="ttdoc">Turns a type into a string. </div><div class="ttdef"><b>Definition:</b> <a href="Context_8cpp_source.html#l00474">Context.cpp:474</a></div></div>
<div class="ttc" id="structchi_1_1DataType_html"><div class="ttname"><a href="structchi_1_1DataType.html">chi::DataType</a></div><div class="ttdoc">A type of data Loose wrapper around llvm::Type*, except it knows which ChiModule it&amp;#39;s in and it embed...</div><div class="ttdef"><b>Definition:</b> <a href="DataType_8hpp_source.html#l00017">DataType.hpp:17</a></div></div>
<div class="ttc" id="namespacechi_html_a5ebe31b8bd52ced63520fbfd749e757fa4f2978dbcab4d04e98b1a567eae27604"><div class="ttname"><a href="namespacechi.html#a5ebe31b8bd52ced63520fbfd749e757fa4f2978dbcab4d04e98b1a567eae27604">chi::CompileSettings::LinkDependencies</a></div><div class="ttdoc">Link in dependencies If this is set, it will be a ready to run module If not, it&amp;#39;ll contain forward d...</div></div>
<div class="ttc" id="structchi_1_1Result_html"><div class="ttname"><a href="structchi_1_1Result.html">chi::Result</a></div><div class="ttdoc">The result object, used for identifiying errors with good diagnostics. </div><div class="ttdef"><b>Definition:</b> <a href="Result_8hpp_source.html#l00072">Result.hpp:72</a></div></div>
<div class="ttc" id="Flags_8hpp_html"><div class="ttname"><a href="Flags_8hpp.html">Flags.hpp</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_97aefd0d527b934f1d99a682da8fe6a9.html">lib</a></li><li class="navelem"><a class="el" href="dir_a2d5e495f4b604d04f57d90095a59dd6.html">core</a></li><li class="navelem"><a class="el" href="dir_a979adfa99d5a8626731f83d5067598b.html">include</a></li><li class="navelem"><a class="el" href="dir_afbc2aa4d9616322ddf4041ba4f8ade6.html">chi</a></li><li class="navelem"><a class="el" href="Context_8hpp.html">Context.hpp</a></li>
    <li class="footer">Generated on Sat Sep 16 2017 17:41:35 for chigraph by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
